package com.synnex.mobile.servier.core.survey.dao.impl;

import com.synnex.mobile.generic.dao.impl.GenericHibernateDaoImpl;
import com.synnex.mobile.servier.core.survey.dao.AnswerItemDao;
import com.synnex.mobile.servier.core.survey.dao.SurveyDao;
import com.synnex.mobile.servier.core.survey.dto.AnswerItem;
import com.synnex.mobile.servier.core.survey.dto.Survey;

/**
 * Created with IntelliJ IDEA.
 * User: kerryf
 * Date: 13-8-9
 * To change this template use File | Settings | File Templates.
 */
public class AnswerItemDaoImpl extends GenericHibernateDaoImpl<AnswerItem,Integer> implements AnswerItemDao {
    public void deleteAnswerBySurveyId(Integer id) {
        StringBuilder hql = new StringBuilder("delete from AnswerItem a where a.question.id=:sId");
        this.getSession().createQuery(hql.toString()).setParameter("sId",id).executeUpdate();
    }
}
